Boook club R-Ladies Bergen, R-Ladies Den Bosch, R-Ladies Amsterdam
origin or upstream.https://github.com/OWNER/REPO.git orgit@github.com:OWNER/REPO.gitgit initusethis::use_git()Tools > Version Control > Project Setuporigin is configured with permission to push/pull.origin on GitHub is a source repo.origin is your primary repo.usethis::use_github().usethis::create_from_github("OWNER/REPO", fork = FALSE).git clone <URL>File > New Project > Version Control > Gitorigin is a source.origin is your primary repo.usethis::use_github(organisation = "ORGNAME").How does this setup happen?
Cloning the source repo (via git clone <URL> or Git client)
usethis::create_from_github("OWNER/REPO", fork = FALSE).
What if you do want to make a pull request?
origin) of the source repo (upstream).upstream.origin is your primary repo (push/pull permission).usethis::create_from_github("OWNER/REPO", fork = TRUE).usethis::create_from_github("OWNER/REPO", fork = TRUE).upstream remote.upstream/main as the upstream tracking branch for local main.git commitgit commit --amendThink of your project as a mountain you’re climbing.
Coding without commits is like free-climbing:
Using a commit is like using anchors when climbing.
If you make a mistake, you can’t fall past the previous commit
[Image placeholder]
git commit --amendStart with your project in a functional state. - Use git status to check this.
::: aside Initial status of project. :::
** Don’t push!**
git commit --amend --no-edit** Don’t push!**
git commit --amend -m "Implement awesome feature"git pushA -- B -- C -- WIP*
WIP*.
git reset --hardLet’s imagine you pushed this state to GitHub by mistake:
A -- B -- C -- WIP (85bf30a)
and proceeded to git commit --amend again locally, leading to this state:
A -- B -- C -- WIP* (6e884e6)
You have two choices:
A -- B -- C -- WIP (85bf30a)
A -- B -- C -- WIP (85bf30a) -- E
You have two choices:
git push --force).A -- B -- C -- D
[R-Ladies Book Club]